package com.wlj.utils.suanfa;

import java.util.List;

public class LinkedListCreator {
    public static Node createLinkedList(List<Integer> data){
        if(data.isEmpty()){ //后特殊
            return null;
        }
        Node firstNode=new Node(data.get(0));
        //假设成立，规模减1
        Node headOfSubList=createLinkedList(data.subList(1,data.size()));
        firstNode.setNext(headOfSubList);
        return firstNode;
    }
}
